package org.ens.delegation.bo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * @author amine
 *
 */
@Entity
@Table(name="echellon")
public class Echellon implements IBusinessObject<Integer>{

	private Integer id;
	private String description;

	@Override
	@Id
	@Column(name="code_eche")
	public Integer getId() {
		return id;
	}

	@Override
	public void setId(Integer pk) {
		id = pk;
	}

	@Column(name="description")
	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj == null || !(obj instanceof Echellon))
			return false;
		Echellon echellon = (Echellon) obj;
		if(echellon.getId() == null)
			return false;
	
		return echellon.getId().equals(this.getId());
	}
	
}
